﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace Mads.CoreDomain
{
  /// <summary>
  /// Represents 
  /// </summary>
  [DataContract]
  public class Race : KeyAbstraction
  {
    #region public properties
    /// <summary>
    /// Route that this race follows.
    /// </summary>
    [DataMember]
    public Route Route { get; set; }

    /// <summary>
    /// When this race leaves initial station.
    /// </summary>
    [DataMember]
    public DateTime Departure { get; set; }

    /// <summary>
    /// Sits from this race.
    /// </summary>
    public IEnumerable<Seat> Sits { get; private set; }
    #endregion

    public Race(Route route, DateTime departure)
    {
      if (route == null)
      {
        throw new ArgumentNullException("route");
      }

      Route = route;
      Departure = departure;
    }
    public Race(uint id) : base(id) 
    { }
  }
}